package com.company;

import com.company.proxy.type1.ProxyByStatic;
import com.company.proxy.type1.RealSubject;
import com.company.proxy.type1.Subject;

/**
 * 静态代理模式测试代码
 */
public class TestForStatic {

    public static void main(String[] args) {
        //直接调用真实对象的方法
        Subject realObj = new RealSubject();
        realObj.method1();
        System.out.println("----------");
        realObj.method2();

        System.out.println("=========================");

        //调用静态代理对象的方法
        Subject proxyByStatic = new ProxyByStatic();
        proxyByStatic.method1();
        System.out.println("----------");
        proxyByStatic.method2();
    }
}
